home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / internet-tools / ipdial / examples / login-ppp.ipdial < prev    next >
Encoding:
Text File  |  1996-04-16  |  2.3 KB  |  96 lines

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;
  3. ;   Example IPDial 2.1 login script for AmiTCP with PPP
  4. ;   $VER: Login-PPP.IPDial 2.1 (16.04.96)
  5. ;
  6. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7. ;
  8. ;   You have to call IPDial with the SANADEV option because there is
  9. ;   no DEVICE command in here. This script uses the variable $LoginID, so
  10. ;   it doesn't have to be changed for different users. The terminal mode
  11. :   is used for entering the corresponding password.
  12. ;
  13. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  14. ;
  15. ;   Send initialization command
  16.  
  17.     SEND "\r\n"
  18.     DELAY 1
  19.     SEND "ATZ\r"
  20.  
  21.  
  22. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  23. ;
  24. ;   Wait for the modems ok; break, if timeout (default: 5 seconds)
  25.  
  26.     WAIT "OK"
  27.     ON STATUS GOTO TIMEOUT
  28.  
  29.  
  30. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  31. ;
  32. ;   Initialize the modem not to hang up, when IPDial terminates (this
  33. ;   will make DTR becoming low)
  34.  
  35.     SEND "AT&D0\r"
  36.     WAIT "OK"
  37.     ON STATUS GOTO TIMEOUT
  38.  
  39.  
  40. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  41. ;
  42. ;   Dialing (2 lines)...
  43.  
  44. Dial:
  45.     ECHO "Trying line 1...\n"
  46.     SEND "ATDT XXXXXXXXXX\r"
  47.     WAIT TIMEOUT=60 "CONNECT" "BUSY" "NO CARRIER"
  48.     ON STATUS GOTO TIMEOUT Login
  49.  
  50.     ECHO "Line 1 is busy - trying second one..."
  51.     DELAY 30
  52.     SEND "ATDT XXXXXXXXXX\r"
  53.     WAIT TIMEOUT=60 "CONNECT" "BUSY" "NO CARRIER"
  54.     ON STATUS GOTO TIMEOUT Login
  55.  
  56.     ECHO "Both lines are busy - delaying 20 seconds..."
  57.     DELAY 20
  58.     GOTO Dial
  59.  
  60.  
  61. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  62. ;
  63. ;   Okay, we are connected. Login into the host.
  64.  
  65. Login:
  66.     ECHO "Connection established!\n"
  67.  
  68.     WAIT "mode:"
  69.     ON STATUS GOTO TIMEOUT
  70.     SEND "ppp\r"
  71.  
  72.     WAIT "login:"
  73.     ON STATUS GOTO TIMEOUT
  74.     SEND $LoginID\r
  75.  
  76.     WAIT "password:"
  77.     ON STATUS GOTO TIMEOUT
  78.     ECHO "\nPlease enter password for" $LoginID ": "
  79.     TERMINAL EOF="\r" NOECHO
  80.  
  81.     ECHO "\nWaitiung for PPP...\n"
  82.     WAIT "starting PPP"
  83.     ON STATUS GOTO TIMEOUT
  84.     EXIT 0
  85.  
  86.  
  87. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  88. ;
  89. ;   Error message: Timeout
  90.  
  91. TIMEOUT:
  92.     ECHO "\nTimeout. Entering terminal mode.\n"
  93.     TERMINAL NOECHO RAW
  94.     EXIT 0
  95.  
  96.